"""
双指针解决
"""

from typing import List


class Solution:
    def twoSum(self, numbers: List[int], target: int) -> List[int]:
        left =0
        right=len(numbers)-1
        while left<right:
            sum=numbers[left]+numbers[right]
            if sum==target:
                return [left+1,right+1]
            elif sum<target:
                left+=1
            else:
                right-=1
        pass

if __name__=='__main__':
    s=Solution()
    numbers=[5,25,75]
    target=100
    res=s.twoSum(numbers,target)
    print(res)
    pass